# https://cirosantilli.com/ourbigbook#vim
# For these snippets, you have to first copy the header text to the clipboard.
# The expansion result then calculates the ID for that header and injects it.
snippet {c
	{child=`substitute(substitute(tolower(@+), '[^a-z0-9]\\+', '-', 'g'), '^-\\|-$', '', 'g')`}
snippet {p
	{parent=`substitute(substitute(tolower(@+), '[^a-z0-9]\\+', '-', 'g'), '^-\\|-$', '', 'g')`}
snippet {t
	{tag=`substitute(substitute(tolower(@+), '[^a-z0-9]\\+', '-', 'g'), '^-\\|-$', '', 'g')`}
snippet \x
	\\x[`substitute(substitute(tolower(@+), '[^a-z0-9]\\+', '-', 'g'), '^-\\|-$', '', 'g')`]

# Standard format for the web archive of something which must be present in the clipboard, e.g.
# ``
# see this link: http://example.com (http/archive.is/XXX[archive])
# ``
snippet arch
	(`@+`[archive])
